import router from "../router";
import VabProgress from 'nprogress'
import {progressBar} from '@/config'
VabProgress.configure({
    easing: 'ease',
    speed: 500,
    trickleSpeed: 200,
    showSpinner: false,
})

/**
 * 路由之后
 */
router.beforeResolve((to, from, next) =>{
    if(progressBar) VabProgress.start();
    next();
})

/**
 * 路由之后
 */
router.afterEach((to, from) =>{
    if(progressBar) VabProgress.done();
})
